package com.start.client.app.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.start.common.entity.StartBaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

@Data
@TableName("start_app_down_record")
 @Schema(name="AppDownloadEntity", description = "app下载记录")
public class ClientDownRecordEntity extends StartBaseEntity {
     @Schema(name="客户端APPID")
    private String appManagerId;
     @Schema(name="下载IP地址")
    private String downIp;
     @Schema(name="客户端类型")
    private String clientType;
     @Schema(name="版本编号")
    private Integer appVersionCode;
     @Schema(name="APP更新类型 0全量更新 1增量更新")
    private Integer appUpdateType;
     @Schema(name="版本类型")
    private String versionType;

    public static ClientDownRecordEntity create(ClientAppVersionEntity appVersion, String clientType, String downIp) {
        ClientDownRecordEntity entity = new ClientDownRecordEntity();
        entity.setAppManagerId(appVersion.getAppManagerId());
        entity.setClientType(clientType);
        entity.setVersionType(appVersion.getVersionType());
        entity.setAppVersionCode(appVersion.getAppVersionCode());
        entity.setAppUpdateType(appVersion.getAppUpdateType());
        entity.setDownIp(downIp);
        return entity;
    }
}
